const friend = {
  data () {
    return {
      memberList: [],
      memberListCopy: []
    }
  },
  methods: {
    // 获取项目成员列表
    getMemberList () {
      let data = {
        'query.project_id': this.pjId
      }
      this.$axios({
        method: 'post',
        url: `${this.$site.oaServer}/front/projectMemberList.htm`,
        data: this.$qs.stringify(data, {indices: false})
      }).then(res => {
        if (res.data.errorMsg) {
          this.$message.error(res.data.errorMsg)
        } else {
          this.memberList = res.data.members
          this.memberListCopy = res.data.members
        }
      })
    },
    searchMember () {
      this.memberList = this.memberListCopy.filter((item) => {
        return item.mname.includes(this.searchName)
      })
    }
  }
}

export default friend
